home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
-
-
- //
- // Header file for "Highlight" node.
- // This is a simple group node that does lcoate highlighting. When
- // the mouse is not over the object, child 0 is displayed. When it
- // is over the object, child 1 is displayed.
- //
- // Author: Howard Look
- //
-
- #ifndef _HIGHLIGHT_H_
- #define _HIGHLIGHT_H_
-
- #include <Inventor/nodes/SoSeparator.h>
-
- class Highlight : public SoSeparator {
-
- // Define typeId, name and field stuff
- SO_SUBNODE_ID_HEADER(Highlight);
- SO_SUBNODE_FIELD_HEADER(Highlight);
-
- public:
-
- // Constructor
- Highlight();
-
- // Initializes this class
- static void initClass();
-
- protected:
- // We might be tempted to just override changeState, but there
- // is too much work to be duplicated that SoSeparator does, so
- // instead we just make a simple traverse method, then make all
- // the actions that will traverse only one child call it.
- void traverse(SoAction *action);
- virtual void GLRender(SoGLRenderAction *action);
- virtual void rayPick(SoRayPickAction *action);
- virtual void getBoundingBox(SoGetBoundingBoxAction *action);
- virtual void hiddenLine(SoHiddenLineAction *action);
- virtual void painters(SoPaintersAction *action);
-
- // This actually does work to see what was hit and to cause the
- // highlight to occur.
- virtual void handleEvent(SoHandleEventAction *action);
-
- private:
- // Destructor
- ~Highlight();
-
- // Returns the child to traverse for the given state.
- int getWhichChild() const;
-
- // Should we highlight?
- SbBool highlight;
- };
-
- #endif /* HIGHLIGHT_H */
-